MODULE_NAME = platformbusdriver

obj-m += $(MODULE_NAME).o
$(MODULE_NAME)-objs := main.o misc.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
MAKE := make

default:
	$(MAKE) -C $(KDIR) M=$(PWD) modules

clean:
	rm -rf *.o *.ko *.mod.c *.symvers *.order .*.cmd *.mod

ui: uninstall install

i: default
	sudo insmod $(MODULE_NAME).ko
	sudo dmesg | grep -i $(MODULE_NAME)

u:
	sudo rmmod $(MODULE_NAME).ko
	sudo dmesg | grep -i $(MODULE_NAME)